Skip to content
This repository has been archived by the owner on Oct 9, 2023. It is now read-only.

Introducing FlytePropeller TURBO Mode #minor #219

Merged
merged 9 commits into from
Feb 4, 2021
Merged

Introducing FlytePropeller TURBO Mode #minor #219

merged 9 commits into from
Feb 4, 2021

Conversation

kumare3
Copy link
Contributor

@kumare3 kumare3 commented Jan 31, 2021

TL;DR

This PR adds a new configuration to FlytePropeller which is enabled by default. This improves the transition latency of FlytePropeller by an order of magnitude or more. Absolute comparison to come soon.

Type

  • Bug Fix
  • Feature
  • Plugin

Are all requirements met?

  • Code completed
  • Smoke tested
  • Unit tests added
  • Code documentation added
  • Any pending items have an associated Issue

Complete description

Currently FlytePropeller event loop is designed to make the smallest forward progress in each round. There are cases in which the round progress is purely book-keeping. For example moving a workflow from accepted to Running state. Moving a node from new to queued to running state. This is done so that state is resilient from crashes.

the turbo mode, essentially waits for the one of these rounds to complete and optimistically progresses to the next round using the updated state. To add safety to the optimistic progress we can configure bounds.

The psuedo algorithm

w -> Original workflow state
w1 -> updated workflow state

while w1 != w and round < configured:
     w1 = try_mutate(w)
     if w1 != w:
         record(w1)
         w = w1
         round++

Tracking Issue

flyteorg/flyte#676

 - Turbo mode in FlytePropeller
@kumare3 kumare3 requested a review from EngHabu as a code owner January 31, 2021 05:45
@codecov-io
Copy link

Codecov Report

Merging #219 (cbc932f) into master (7447a5d) will increase coverage by 0.00%.
The diff coverage is 69.23%.

EngHabu
EngHabu previously approved these changes Jan 31, 2021
Copy link
Contributor

@EngHabu EngHabu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sweet!

@@ -74,6 +74,7 @@ type Config struct {
MaxDatasetSizeBytes int64 `json:"max-output-size-bytes" pflag:",Maximum size of outputs per task"`
KubeConfig KubeClientConfig `json:"kube-client-config" pflag:",Configuration to control the Kubernetes client"`
NodeConfig NodeConfig `json:"node-config,omitempty" pflag:",config for a workflow node"`
EnableFastFollow bool `json:"enable-fast-follow" pflag:",Boolean flag that enables Fast Follow mode, this makes Propeller proceed to another round on successful write to etcD."`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: formatting seems to have more spaces... tabs?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

will fix formatting

pkg/controller/handler.go Show resolved Hide resolved
@kumare3 kumare3 changed the title [WIP] Propeller Fast follow - Turbo mode in FlytePropeller Introducing FlytePropeller TURBO Mode Jan 31, 2021
@kumare3 kumare3 changed the title Introducing FlytePropeller TURBO Mode Introducing FlytePropeller TURBO Mode #minor Jan 31, 2021
@kumare3 kumare3 requested a review from EngHabu February 1, 2021 05:20
pkg/controller/handler.go Show resolved Hide resolved
@@ -74,6 +76,8 @@ type Config struct {
MaxDatasetSizeBytes int64 `json:"max-output-size-bytes" pflag:",Maximum size of outputs per task"`
KubeConfig KubeClientConfig `json:"kube-client-config" pflag:",Configuration to control the Kubernetes client"`
NodeConfig NodeConfig `json:"node-config,omitempty" pflag:",config for a workflow node"`
EnableTurboMode bool `json:"enable-turbo-mode" pflag:",Boolean flag that enables Turbo-mode, this makes Propeller proceed to another round on successful write to etcD."`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we really have two flags? or just have it enabled all the time and use MaxStreakLength <= 1 meaning it essentially has no effect?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that is interesting

pkg/controller/workflowstore/inmemory.go Show resolved Hide resolved
@kumare3 kumare3 requested a review from EngHabu February 1, 2021 22:16
Copy link
Contributor

@EngHabu EngHabu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I left a couple of comments to write a bit more code docs...

pkg/controller/handler.go Show resolved Hide resolved
pkg/controller/handler.go Show resolved Hide resolved
pkg/controller/workflowstore/inmemory.go Show resolved Hide resolved
pkg/controller/handler.go Show resolved Hide resolved
@kumare3 kumare3 merged commit 7a72770 into master Feb 4, 2021
eapolinario pushed a commit to eapolinario/flytepropeller that referenced this pull request Aug 9, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants